<?php
header("Content-Type:text/html; charset=utf-8");

require_once("../../connectMysql/connetMysql.class.php");
$db=new connetMysql;
$con=$db->getConnect();

session_start();               //为了将验证码打乱
$_SESSION['checkCode']=md5(time());     //将验证码的值存入session中
$username = $_POST["input_username"];
$userpassword = $_POST["input_userpassword"];


$result = mysqli_query($con,"SELECT * FROM user where username='$username' AND userpassword='$userpassword' AND userstate='1'");
$result2 = mysqli_query($con,"SELECT * FROM user where usermail='$username' AND userpassword='$userpassword' AND userstate='1'");

if($row = mysqli_fetch_array($result))
  {
	  echo "登陆成功！";   
  }
else if($row2 = mysqli_fetch_array($result2))
{
	  echo "登陆成功！";   
  }
else
  {
	  echo "登陆失败！";  
  }

mysqli_close($con);
?>
